import json

json_str = '''{
  "user_profile": {
    "id": 12345,
    "username": "john_doe",
    "full_name": "张三",
    "age": 28,
    "is_active": true,
    "is_premium": false,
    "registration_date": "2023-05-15",
    "last_login": null
  }
}'''

rs = json.loads(json_str)
print(rs)
print(type(rs))
print(type(rs["user_profile"]))
#打开json文件转为python数据
with open('data.txt') as fp:
    python_list =json.load(fp)
    print(python_list)
    print(type(python_list))
    print(type(python_list[0]))